<form action="" method="get" name="search" id="search"  onsubmit="return ajax_list();" >
<input type="hidden" name="action" id="action" value="blog_list" />
<input type="hidden" name="uid" id="uid" value="<tpl> $uid </tpl>" />
<table  class="from_table">
	<tr>
		<th width="77"><tpl> $langSysSpaceSelectType </tpl>：</th>
		<td>
			<select name="blog_type" id="blog_type">
				<option value="" <tpl> if $condition.blog_type eq '' </tpl> selected <tpl> /if </tpl> ><tpl> $langSysSpaceNoType </tpl></option>
				<option value="0" <tpl> if $condition.blog_type eq '0' </tpl> selected <tpl> /if </tpl> ><tpl> $langSpaceBlogCommon </tpl></option>
				<option value="1" <tpl> if $condition.blog_type eq '1' </tpl> selected <tpl> /if </tpl> ><tpl> $langSpaceBlogCommend </tpl></option>
			</select>						
		</td> 
		<th><tpl> $langSysSpaceKeywords </tpl>：</th>   
		<td><input type="text" name="keywords" id="keywords"  class="txtinput_short" value="<tpl> $condition.keywords </tpl>" /></td>
	</tr>
	<tr>
		<th style=" height:35px"></th>
		<td height="50" colspan="4">	
			<span class="btn_left"><input type="submit" name="submit"  class="btn_submit" value="<tpl> $langSysSearch </tpl>" /></span>
			<span class="btn_left"><input type="reset" name="reset"  class="btn_submit" value="<tpl> $langSpaceReset </tpl>" /></span>
		</td>
		</tr>
	
</table>
</form>
<tpl> if $blog_array[0].blogid neq '' </tpl>
<form action="javascript:void(null);" id="bloglist" name="spacelist" method="post">
	<table class="from_table2_one top-1">
		<tr class="area_ajax_list_title">
			<th class="pd-left" width="50" align="left" style="text-align:left"><tpl> $langSysSpaceSelect </tpl></th>
			<th width="100" align="left" style="text-align:left"><tpl> $langSysSpaceUsername </tpl></th>
			<th width="200" align="left" style="text-align:left"><tpl> $langSpaceBlogTitle </tpl></th>
			<th width="100" align="left" style="text-align:left"><tpl> $langSpaceBlogLei </tpl></th>
			<th width="150" align="left" style="text-align:left"><tpl> $langSysSpacePubDate </tpl></th>
		</tr>
		<div id="liststylealignleft">
		<tpl> section name=i loop=$blog_array </tpl>
		<tr>
			<td class="pd-left" width="50" ><input type="checkbox" name="blogid[]" value="<tpl> $blog_array[i].blogid </tpl>" /></td>
			<td class="supplylist" width="130"><tpl> $blog_array[i].username </tpl></td>
		  <td width="180" class="supplylist"><a href="../app/<tpl> $app_module.app_module_sign </tpl>/index.php?action=blog_view&uid=<tpl> $blog_array[i].uid </tpl>&bid=<tpl> $blog_array[i].blogid </tpl>" target="_blank" title="<tpl> $blog_array[i].title </tpl>"><tpl> $blog_array[i].title_cut </tpl></a></td>
		  <td class="supplylist" width="100">
				<tpl> if $blog_array[i].classid eq '0' </tpl>
					<tpl> $langSpaceBlogCommon </tpl>
				<tpl> else </tpl>
					<tpl> $langSpaceBlogCommend </tpl>
				<tpl> /if </tpl>
		  </td>
		  <td><tpl> $blog_array[i].dateline </tpl></td>
		</tr>
		<tpl> /section </tpl>
		</div>
		
  </table>
  <div class="table-5-bottom">
  <div class="p-left"><span class="btn_left"><input type="button" value="<tpl> $langSupplyControlSel </tpl>" id="control_seclect" name="control_seclect" class="btn_submit" /> </span>
				<span class="btn_left"> <input type="button" value="<tpl> $errSpaceDel </tpl>" id="blog_del" name="blog_del"  class="btn_submit" /></span>			
				<span class="btn_left"> <input type="button" value="<tpl> $langSysSpaceBack </tpl>" id="back" name="back"  class="btn_submit"  onclick="ajax_list_back( 'action=ajax_list' )"/></span>			
				<span class="btn_marginright"><tpl> $page_list </tpl></span>
  </div></div>
</form>
<tpl> else </tpl>
  <tpl> $langSysCNoThing </tpl> <a href="javascript:void(null);" onclick="ajax_list_back( 'action=ajax_list' )"><tpl> $langSysSpaceClickBack </tpl></a>
<tpl> /if </tpl>
<div id="question" style="display:none; cursor: default; padding:10px"> 
        <b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-top:10px; padding-bottom:10px"><tpl> $langCConfirmDelete </tpl></b> <br />
        <input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
        <input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
		<input type="hidden" id="del_value" />
</div> 
<script language="javascript">
var question = $('#question')[0];
$(document).ready(function() {
	//控制选择
	$('#control_seclect').click(
		function(){
			$('#bloglist input[@type=checkbox]').each(function(){
				$(this).attr('checked',!$(this).attr('checked'))
			})
		}
	)
	
	var options = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("../app/<tpl> $app_module.app_module_sign </tpl>/system.php?action=blog_list&keywords=<tpl> $condition.keywords </tpl>&blog_type=<tpl> $condition.blog_type </tpl>&uid=<tpl> $uid </tpl><tpl>if $space_array|@count neq 1</tpl>&curpage=<tpl> $curpage</tpl><tpl>/if</tpl>");
						}
					},
		type:      'post',
		dataType:  'json'
	};
	$("#blog_del").click(function(){
		$.blockUI(question, { width: '275px' });
	});
	
	$('#yes').click(function() {
		$.unblockUI();
		$('#bloglist').attr("action", "../app/<tpl> $app_module.app_module_sign </tpl>/system.php?action=del_blog");
		$('#bloglist').ajaxSubmit(options);
	});
	$('#no').click($.unblockUI);
});
//搜索
function ajax_list(){
	/*取表单参数*/
	var queryString=$("#search").formSerialize();
	$.ajax({
		url: "../app/<tpl> $app_module.app_module_sign </tpl>/system.php",
		data: queryString,
		type:'get',
		dataType:"html",
		beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
		success: function(msg){
			hideMessage();
			$("#result_content").html(msg);
			hideLoading();
		}
	});
	return false;
}
//返回空间列表
function ajax_list_back ( str ) {
	$.ajax({
		url: "../app/<tpl> $app_module.app_module_sign </tpl>/system.php",
		data: str,
		type:'get',
		dataType:"html",
		beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
		success: function(msg){
			hideLoading();
			$('#result_content').html(msg);
		}
	});
	return false;	
}
</script>